<div class="row margin-0">
	<div class="col-md-6 col-sm-6 col-xs-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">
					菜单数据
					<div class="btn btn-default btn-xs auto-collapse active" data-toggle="button" aria-pressed="false" autocomplete="off">自动折叠</div>
					<div class="btn btn-xs btn-danger pull-right redo">重绘</div>
				</h3>
			</div>
			<div class="panel-body tree-menu-data padding-0" contenteditable="true" style="height: 550px; overflow: auto;">
				<pre class="margin-0" style="border: none;">
	[ {
		collapse : true,
		active : false,
		icon : 'icon-wrench',
		text : '一级',
		badge : '<i class="icon-heart-empty">&nbsp;9527</i>',
		children : [ {
		collapse : true,
			text : '二级',
			children : [ {
			collapse : true,
				active : true,
				text : '三级',
				// uri : 'need a uri'
			}, {
				collapse : true,
				text : '三级',
			} ]
		}, {
			collapse : true,
			text : '二级',
		} ]
	}, {
		collapse : true,
		text : '一级',
		children : [ {
			collapse : true,
			text : '二级',
			children : [ {
				collapse : true,
				text : '三级',
			}, {
				collapse : true,
				text : '三级',
			} ]
		}, {
			collapse : true,
			text : '二级',
		}, {
			collapse : true,
			text : '二级',
			children : [ {
				collapse : true,
				text : '三级',
			}, {
				collapse : true,
				text : '三级',
			} ]
		} ]
	} ]
</pre>
			</div>
		</div>
	</div>
	<div class="col-md-6 col-sm-6 col-xs-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">菜单</h3>
			</div>
			<div class="panel-body tree-menu"></div>
		</div>
	</div>
</div>
<script src="${request.contextPath}/js/suredy-tree-menu.js"></script>
<script type="text/javascript">
	$(function() {
		//var data = ${data};

		$('div.btn.redo').on('click', function() {
			$('.tree-menu').treeMenu(eval('(' + $('.tree-menu-data pre').html() + ')'), {
				autoCollapse : $('.btn.auto-collapse.active').length > 0
			});
		});

		$('div.btn.redo').trigger('click');
	});
</script>